PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Save

Save is an application command that saves an object or objects.

SYNTAX
save referenceToObject [ in referenceToFile ]
PARAMETERS
referenceToObject
A reference to the object or objects to be saved. Class: Reference
referenceToFile
A reference of the form file nameString or alias nameString that specifies the file in which to save the objects (see "Notes"). Class: Reference Default value: The file in which the object was last saved. If the object has not been saved before, the application creates a new file.
RESULT

None

EXAMPLE
tell application "AppleWorks"
    save document "Stupendous" in file ¬
    "Hard Disk:Documents:Large Documents:Elephantine"
end tell
NOTES

To specify the name ( nameString ) of a file in which to save the specified object or objects, use a string of the form " Disk : Folder1 : Folder2 :...: Filename " ; for details, see References to Files. You can also specify a string with only a filename (" Filename "). In this case, the application attempts to find the file in the current directory. (The current directory is typically the directory where the application was launched, the directory where the application last opened or saved a previous document, or another directory specified by the application. The current directory may be affected by settings in the General Controls control panel.)

If you use the form file nameString and the specified file is not present in the specified location, the application creates a file with the specified name in that location. If you use the form alias nameString and the specified file is not present in the specified location, the script won't compile.

The Save command will replace, without asking, an existing file with the same name as the specified file (if one exists).


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)